/* eslint-disable perfectionist/sort-imports */
// eslint添加忽略 createApp必须第一个引入。否则报错！！！
import { createApp } from 'vue'
import type { Component } from 'vue'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'

//  第三方UI插件 element ui
import ElementPlus from 'element-plus'
// 引入moment
import moment from 'moment'

// import VxeUIAll from 'vxe-pc-ui'
// vxeTable表格插件
import VXETable from 'vxe-table'
// i18n 国际化插件
import i18n from '@/components/i18n/index.js'
// 全局混入
import { globalMixins } from '@/mixins/globalMixins.js'
import App from './App.vue'

// 封装后 插件
import router from './router/index.js'
import pinia from './store/index.js'
// 引入主要CSS文件
import '@/assets/styles/main.scss'
import 'element-plus/dist/index.css'
import 'vxe-table/lib/style.css'
import 'vxe-pc-ui/lib/style.css'
import 'moment/locale/zh-cn'

moment.locale('zh-cn')
const app = createApp(App)
app.use(ElementPlus) // element UI
app.mixin(globalMixins) // 全局混入
app.use(router) // 路由router
app.use(pinia) // pinia 状态管理
app.use(i18n) // i18n国际化配置
app.use(VXETable) // vxe组件
// app.use(VxeUIAll) // vxeui
// 精确类型声明
type IconComponent = Component<object, object, any>
// 全局注册 elementPlus Icon
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(`${key}`, component as IconComponent)
}
app.mount('#app')
